package com.example.hotelmanagement.service.impl;

import com.example.hotelmanagement.entity.Room;
import com.example.hotelmanagement.mapper.RoomMapper;
import com.example.hotelmanagement.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomServiceImpl implements RoomService {

    @Autowired
    private RoomMapper roomMapper;

    @Override
    public List<Room> findAll() {
        return roomMapper.findAll();
    }

    @Override
    public Room findById(Integer roomId) {
        return roomMapper.findById(roomId);
    }

    @Override
    public Room findByRoomNumber(String roomNumber) {
        return roomMapper.findByRoomNumber(roomNumber);
    }

    @Override
    public List<Room> findByStatus(String status) {
        return roomMapper.findByStatus(status);
    }

    @Override
    public int save(Room room) {
        return roomMapper.insert(room);
    }

    @Override
    public int update(Room room) {
        return roomMapper.update(room);
    }

    @Override
    public int delete(Integer roomId) {
        return roomMapper.delete(roomId);
    }
}